package com.movitech.mobile.cz.base.supplier.mapper.ext;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.movitech.mobile.cz.base.supplier.entity.SSupplierRcRelate;
import com.movitech.mobile.cz.base.supplier.entity.ext.ExtSSupplierRcRelate;
import com.movitech.mobile.cz.base.supplier.entity.ext.ExtSSuppliers;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 供方与地区公司关联 Mapper 接口
 * </p>
 *
 * @author Movitech Mobile
 * @since 2018-02-28
 */
@Component
@Mapper
public interface ExtSSupplierRcRelateMapper extends BaseMapper<SSupplierRcRelate> {

	List<SSupplierRcRelate> getSupplierRcRelateBySuppliersId(@Param("suppliersId") String suppliersId);

	int addSupplierRcRelateByUserAndSupplierId(@Param("userId")String userId, @Param("supplierId")String supplierId);

	long getSuppliersMulitListCounts(Map<String, Object> map);

	List<ExtSSuppliers> getSuppliersMulitList(Map<String, Object> map);

	long getSuppliersListCounts(Map<String, Object> map);

	List<ExtSSuppliers> getSuppliersList(Map<String, Object> map);

	long getQualifiedSuppliersListCounts(Map<String, Object> map);

	List<ExtSSuppliers> getQualifiedSuppliersList(Map<String, Object> map);

	public List<ExtSSupplierRcRelate> getCompanyListByStatus(@Param("supplierBigStatus")String supplierBigStatus, @Param("supplierId")String supplierId);

	public ExtSSupplierRcRelate getExtId(@Param("id")String id);

	public String getQualifiedCategoryIds(@Param("supplierBigStatus")String supplierBigStatus, @Param("supplierId")String supplierId);

	public String getQualifiedCompIds(@Param("supplierBigStatus")String supplierBigStatus, @Param("supplierId")String supplierId);

	/**
	 * 查询供方在MBS审批中的个数
	 * @param supplierId
	 * @return
	 */
	public Integer getApprovalCount(@Param("supplierId")String supplierId);

    void emptyActualIdsById(@Param("id") String id);
}
